﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AvantGameMachine.Graphics
{
    public struct Color
    {
        private float[] c;

        public Color(float _r, float _g, float _b, float _a)
        {
            c = new float[4];
            R = _r;
            G = _g;
            B = _b;
            A = _a;
        }

        public Color(float _r, float _g, float _b)
        {
            c = new float[4];
            R = _r;
            G = _g;
            B = _b;
            A = 1.0f;
        }

        public Color(PosVector _v)
        {
            c = new float[4];
            R = _v.X;
            G = _v.Y;
            B = _v.Z;
            A = 1.0f;
        }

        public static Color Black()
        {
            return new Color(0.0f, 0.0f, 0.0f);
        }

        public static Color White()
        {
            return new Color(1.0f, 1.0f, 1.0f);
        }

        public static Color Red()
        {
            return new Color(1.0f, 0.0f, 0.0f);
        }

        public static Color Green()
        {
            return new Color(0.0f, 1.0f, 0.0f);
        }

        public static Color Blue()
        {
            return new Color(0.0f, 0.0f, 1.0f);
        }

        public float R
        {
            get { return c[0]; }
            set { c[0] = value; }
        }

        public float G
        {
            get { return c[1]; }
            set { c[1] = value; }
        }

        public float B
        {
            get { return c[2]; }
            set { c[2] = value; }
        }

        public float A
        {
            get { return c[3]; }
            set { c[3] = value; }
        }
    }
}
